/**
 * this class encapsulates calculations and data
 * for every equilateral triangles.
 */
public class EquilateralTriangle extends RegularPolygon implements ITriangle {

	/**
	 * a triangle consists of three length-values.
	 * these lengths must be positiv.
	 * the 3 length-values are equal, resulting
	 * in an equilateral triangle.
	 */
	public EquilateralTriangle(double s) {
		super(s, 3);
	}
	
	/**
	 * calculates the area of the triangle
	 * other calc.
	 */
	@Override
	public double area() {
		double area = ((getS() * getS()) * Math.sqrt(3)) / 4; //area > 0
		return area;
	}
	
	@Override
	public int edges() {
		return 3;
	}
}
